
package jtrimet.android.widget;

import java.util.*;
import jtrimet.*;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.*;

public class LocationListView extends ListView
{
	public LocationListView(final Context context, List<Location> Locations)
	{
		this(context);
		setLocations(Locations);
	}

	public LocationListView(Context context)
	{
		super(context);
	}

	public void setLocations(List<Location> Locations)
	{
		ListAdapter adapter = new AbstractListAdapter(Locations)
		{

			@Override
			public View getView(int position, View convertView, ViewGroup parent)
			{
				return new LocationView( LocationListView.this.getContext(), (Location) this.getItem(position));
			}
			
		};
		this.setAdapter(adapter);
		
	}
}
